package com.lemt.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lemt.mall.entity.Inventory;
import com.lemt.mall.mapper.InventoryMapper;
import com.lemt.mall.service.IInventoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zik
 * @since 2023-09-10
 */
@Service
public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory> implements IInventoryService {

    @Resource
    private InventoryMapper inventoryMapper;

    @Override
    public List<Inventory> getByGoodsId(Integer id) {
        return  inventoryMapper.selectList(new LambdaQueryWrapper<Inventory>().eq(Inventory::getGoodsId, id));
    }
}
